package com.kstech.mp3604.fragments

import com.kstech.mp3604.R
import com.kstech.mp3604.base.BaseDialogFragment
import com.kstech.mp3604.databinding.DialogQuerydataBinding

/**
 * 查询按钮
 */
class DialogQueryDataFragment :
    BaseDialogFragment<DialogQuerydataBinding>(DialogQuerydataBinding::inflate) {
    override fun onInitView() {

        binding.closeDialog.setOnClickListener {
            dialog!!.cancel()
        }
        binding.apply {
            historyTaskButton.setOnClickListener {
                val beginTransaction = childFragmentManager.beginTransaction()
                beginTransaction.replace(R.id.fragment_container_view, QueryHistoryTaskFragment())
                beginTransaction.commit()

            }
            logButton.setOnClickListener {
                val beginTransaction = childFragmentManager.beginTransaction()
                beginTransaction.replace(R.id.fragment_container_view, QueryLogFragment())
                beginTransaction.commit()
            }
            errorButton.setOnClickListener {
                val beginTransaction = childFragmentManager.beginTransaction()
                beginTransaction.replace(R.id.fragment_container_view, QueryErrorFragment())
                beginTransaction.commit()
            }
            instructionBookButton.setOnClickListener {
                val beginTransaction = childFragmentManager.beginTransaction()
                beginTransaction.replace(R.id.fragment_container_view, QueryUserBookFragment())
                beginTransaction.commit()
            }
        }
    }


}